﻿namespace BlamanticUI.Components;

/// <summary>
/// Represents a dimmer that cover on the panel.
/// </summary>
[CssClass("dimmer",Order =900)]
public class Dimmer : BlazorChildContentComponentBase, IHasUIComponent, IHasActive, IHasDisabled, IHasVerticalAlignment, IHasInverted
{
    /// <summary>
    /// Initializes a new instance of the <see cref="Dimmer"/> class.
    /// </summary>
    public Dimmer()
    {
    }

    /// <summary>
    /// Gets or sets a value indicating whether this state is actived.
    /// </summary>
    /// <value>
    ///   <c>true</c> if actived; otherwise, <c>false</c>.
    /// </value>
    [Parameter] public bool Active { get; set; }
    /// <summary>
    /// Gets or sets a value indicating whether this <see cref="IHasDisabled" /> is disabled.
    /// </summary>
    /// <value>
    ///   <c>true</c> if disabled; otherwise, <c>false</c>.
    /// </value>
    [Parameter] public bool Disabled { get; set; }

    /// <summary>
    /// Gets or sets display in full screen.
    /// </summary>
    [Parameter] [CssClass("page")] public bool FullScreen { get; set; }
    /// <summary>
    /// Gets or sets a value indicating whether adapted inverted background by parent component.
    /// </summary>
    /// <value>
    ///   <c>true</c> if adapted; otherwise, <c>false</c>.
    /// </value>
    [Parameter] public bool Inverted { get; set; }

    /// <summary>
    /// Gets or sets the cover object partially.
    /// </summary>
    [Parameter] [CssClass(Order = 66)] public PartialPosition? Partially { get; set; }
    /// <summary>
    /// Gets or sets the opacity.
    /// </summary>
    [Parameter] [CssClass(Order = 60)] public OpacityLevel? Opacity { get; set; }
    /// <summary>
    /// Gets or sets the vertical alignment of text.
    /// </summary>
    [Parameter] public VerticalAlignment? VerticalAlignment { get; set; }
    /// <summary>
    /// Defines the level of opcacity in dimmer.
    /// </summary>
    public enum OpacityLevel
    {
        /// <summary>
        /// 不透明度大约为 65%。
        /// </summary>
        Medium,
        /// <summary>
        /// 不透明度大约为 45%
        /// </summary>
        Light,
        /// <summary>
        /// 不透明度大约为 25%
        /// </summary>
        [CssClass("very light")]
        VeryLight
    }

    /// <summary>
    /// The position of partial in <see cref="Dimmer"/> component.
    /// </summary>
    public enum PartialPosition
    {
        /// <summary>
        /// The top position.
        /// </summary>
        Top,
        /// <summary>
        /// The center position.
        /// </summary>
        Center,
        /// <summary>
        /// The bottom position.
        /// </summary>
        Bottom
    }
}
